﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DataAccess;
using System.Diagnostics;

namespace Logic
{
    public class FS0103_SubLogic
    {
        FS0103_SubDataAccess fS0103_SubDataAccess = new FS0103_SubDataAccess();

        #region 通过iAutoID检索需求信息
        public DataTable getRequirement(string strAutoID)
        {
            return fS0103_SubDataAccess.getRequirementInfo(strAutoID);
        }
        #endregion

        #region 保存
        public void Save(string strRequirementNo, string strCategory, string strRequirementName, string strRequirementDescription, byte[] byteRequirementPic, string strRequirementPicName)
        {
            fS0103_SubDataAccess.Save(strRequirementNo, strCategory, strRequirementName, strRequirementDescription, byteRequirementPic, strRequirementPicName);
        }
        #endregion
        #region 修改
        public void Modify(string strAutoID,string strRequirementNo, string strCategory, string strRequirementName, string strRequirementDescription, byte[] byteRequirementPic, string strRequirementPicName)
        {
            fS0103_SubDataAccess.Modify(strAutoID,strRequirementNo, strCategory, strRequirementName, strRequirementDescription, byteRequirementPic, strRequirementPicName);
        }
        #endregion

        #region 校验重复
        public bool CheckExists(string strRequirementNo)
        {
            DataTable dt = fS0103_SubDataAccess.getRequirement(strRequirementNo);
            if (dt!=null&&dt.Rows.Count>0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        #endregion
    }
}
